<style >
  table.formTable {
    font-family: verdana, arial, sans-serif;
    font-size: 0.875rem;
    color: #333333;
    border-width: 0px;
    border-color: #dcdfe6;
    border-collapse: collapse;
    width: 100%;
  }

  table.formTable td {
    border-width: 0px;
    padding: 20px;
    border-style: solid;
    border-color: #dcdfe6;
    background-color: #ffffff;
    padding:2px;
    text-align: center;
  }

  table.formTable td:first-child {
    width: 100px;
    text-align: right;
  }

  table.formTable td:last-child {
  	/*  color: #E6A23C;  */
  }
  
      #tableIconForBizStylePoint + .layui-table-view .layui-table-body tbody > tr > td {
        padding: 0;
    }

    #tableIconForBizStylePoint + .layui-table-view .layui-table-body tbody > tr > td > .layui-table-cell {
        height: 60px;
        line-height: 60px;
    }

    .tdImg {
        width: 35px;
        height:35px;
        max-width: none;
        cursor: pointer;
    }

    .layui-table-view {
        margin: 0;
    }
    #tableBizStylePoint + .layui-table-view .layui-table-body tbody > tr > td {
        padding: 0;
    }

    #tableBizStylePoint + .layui-table-view .layui-table-body tbody > tr > td > .layui-table-cell {
        height: auto;
        line-height: 30px;
        padding: 0 5px;
    }

    .tdImg {
        width: 35px;
        max-width: none;
        cursor: pointer;
    }

    .layui-table-view {
        margin: 0;
    } 
    
</style>
<!-- 正文开始 -->
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-body table-tool-mini">
            <div class="layui-form toolbar" id="tbToolBar">
                <div class="layui-form-item">
					<div class="layui-inline">
						<button id="btnAddBizStylePoint" class="layui-btn icon-btn"><i class="layui-icon">&#xe654;</i>新增</button>
					</div>
                    <div class="layui-inline" style="float: right;margin-right: 0px;">
						<div class="layui-inline" style="padding-right: 0px;margin-right: 0px;">
							<label class="layui-form-label w-auto">名称</label>
							<div class="layui-input-inline mr0">
								<input name="name" class="layui-input" type="text" placeholder="请输入名称"/>
							</div>
						</div>
						<div class="layui-inline" style="padding-right: 0px;margin-right: 0px;">
							<button class="layui-btn icon-btn" lay-filter="formSubSearchBizStylePoint" lay-submit>
								<i class="layui-icon">&#xe615;</i>查询
							</button>
						</div>					
					</div>
				</div>
				<table class="layui-table" id="tableBizStylePoint" lay-filter="tableBizStylePoint"></table>
			</div>
		</div>
	</div>
</div>

<!-- 表格操作列 -->
<script type="text/html" id="tableBarBizStylePoint">
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit">编辑</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
	<a class="layui-btn layui-btn-warm layui-btn-xs" lay-event="copy">复制</a>
</script>
<!-- 表格状态列 -->
<script type="text/html" id="tableStateBizStylePoint">
#[[  {{#  if(d.status === '1'){ }}
    <span style="color: #23aa2e;">正常</span>
  {{#  } else { }}
	<span style="color: #ff0000;">禁止</span>
  {{#  } }}
]]#
</script>


<!-- 表单弹窗-->
<script type="text/html" id="modelBizStylePoint"> 
<form id="modelBizStylePointForm" lay-filter="modelBizStylePointForm" class="layui-form model-form" style="padding: 0px;">
	<input name="id" type="hidden"   />
	<div class="layui-card">
	    <div class="layui-card-body" style="padding:0px;padding-top: 1px;">
			<div class="layui-tab layui-tab-card" style="box-shadow:none;" >
			  <ul class="layui-tab-title">
				<li class="layui-this">基础信息</li>
			    <li >点</li>
			    <li>标签</li>
			    <li>图标</li>
			  </ul>
			  <div class="layui-tab-content">
			    <div class="layui-tab-item layui-show">
					<table class="formTable">
						<tr>
							<td style="text-align: left;">名称</td>
						</tr>
						<tr>
							<td>
			               		<input name="name" autocomplete="off"  placeholder="请输入名称" type="text" class="layui-input" lay-verify="required" required/>
							</td>
						</tr>
						<tr>
							<td style="text-align: left;">标识</td>
						</tr>
						<tr>
							<td>
			               		<input name="code" autocomplete="off"  placeholder="请输入标识" type="text" class="layui-input"  />
							</td>
						</tr>
						<tr>
							<td style="text-align: left;">请选择位置模板</td>
						</tr>
						<tr>
							<td>
								<input name="stylePointPositionId" id="stylePointPositionId" type="hidden"/>
			               		<input  id="stylePointPositionName" autocomplete="off"  placeholder="请选择模板" type="text" class="layui-input"  />
								<button class="layui-btn layui-btn-xs" id="positionselect-btn" >选择</button>
							</td>
						</tr>
					</table>

				</div>
			    <div class="layui-tab-item">
					<table class="formTable">
						<tr>
							<td colspan="4" style="text-align: left;">显示隐藏|点颜色|像素大小</td>
						</tr>
						<tr>
						    <td style="text-align: left;"> 
			                	<select name="showForPoint" lay-filter="showForPoint"  lay-verify="required" required>
						        	<option value="0">隐藏</option>
									<option value="1">显示</option>
						      	</select>
							</td> 
							<td colspan="3"  style="text-align: left;">
								<div class="layui-inline" style="padding-right: 0px;margin-right: 0px;">
									<input type="hidden" name="colorForPoint" id="colorForPoint-input">
									<div id="colorForPoint"></div>	
								</div>
								<div class="layui-inline" style="padding-right: 0px;margin-right: 0px;width: 325px;">
			               			<input name="pixelSizeForPoint" autocomplete="off"  placeholder="请输入像素大小" type="text" class="layui-input" />
								</div>					
			                </td> 
						</tr>
						<tr>
							<td colspan="4" style="text-align: left;">点边框颜色和像素</td>
						</tr>
						<tr>
							<td colspan="4"  style="text-align: left;">
								<div class="layui-inline" style="padding-right: 0px;margin-right: 0px;">
									<input type="hidden" name="outlineColorForPoint" id="outlineColorForPoint-input">
									<div id="outlineColorForPoint"></div>
								</div>
								<div class="layui-inline" style="padding-right: 0px;margin-right: 0px;width: 432px;">
			                		<input name="outlineWidthForPoint" autocomplete="off"  placeholder="请输入像素大小" type="text" class="layui-input" />
								</div>					
			                </td> 
						</tr>
						<tr>
							<td colspan="4" style="text-align: left;">可视范围</td>
						</tr>
						<tr>
							<td colspan="2">
			                	<input name="displayNearForPoint" autocomplete="off"  placeholder="请输入近" type="text" class="layui-input" />
			                </td>
							<td colspan="2">
			                	<input name="displayFarForPoint" autocomplete="off"  placeholder="请输入远" type="text" class="layui-input" />
			                </td>
						</tr>
						<tr>
							<td colspan="4" style="text-align: left;">距离缩放</td>
						</tr>
						<tr>
							<td >
			                	<input name="scalarNearForPoint" autocomplete="off" placeholder="请输入近" type="text" class="layui-input" />
			                </td>
							<td >
			                	<input name="scalarNearValueForPoint" autocomplete="off" placeholder="请输入值(近)" type="text" class="layui-input" />
			                </td>
							<td >
			                	<input name="scalarFarForPoint" autocomplete="off" placeholder="请输入远" type="text" class="layui-input" />
			                </td>
							<td >
			                	<input name="scalarFarValueForPoint" autocomplete="off" placeholder="请输入值(远)" type="text" class="layui-input" />
			                </td>
						</tr>
						<tr>
							<td colspan="4" style="text-align: left;">距离透明度</td>
						</tr>
						<tr>
							<td >
			                	<input name="translucencyNearForPoint" autocomplete="off"  placeholder="请输入近" type="text" class="layui-input" />
			                </td>
							<td >
			                	<input name="translucencyNearValueForPoint" autocomplete="off"  placeholder="请输入值(近)" type="text" class="layui-input" />
			                </td>
							<td >
			                	<input name="translucencyFarForPoint" autocomplete="off"  placeholder="请输入远" type="text" class="layui-input" />
			                </td>
							<td >
			                	<input name="translucencyFarValueForPoint" autocomplete="off"  placeholder="请输入值(远)" type="text" class="layui-input" />
			                </td>
						</tr>
					</table>    
				</div>
			    <div class="layui-tab-item">
					<table class="formTable">
						<tr>
							<td colspan="4" style="text-align: left;">显示隐藏|颜色|字体</td>
						</tr>
						<tr>
						    <td style="text-align: left;"> 
			                	<select name="showForLabel" lay-filter="showForLabel"  lay-verify="required" required>
						        	<option value="0">隐藏</option>
									<option value="1">显示</option>
						      	</select>
							</td> 
							<td colspan="3"  style="text-align: left;">
								<div class="layui-inline" style="padding-right: 0px;margin-right: 0px;">
									<input type="hidden" name="fillColorForLabel" id="fillColorForLabel-input">
									<div id="fillColorForLabel"></div>	
								</div>
								<div class="layui-inline" style="padding-right: 0px;margin-right: 0px;width: 325px;">
			               			<input name="fontForLabel" autocomplete="off"  placeholder="请输入（30px sans-serif）" type="text" class="layui-input" />
								</div>					
			                </td> 
						</tr>
						<tr>
							<td colspan="4" style="text-align: left;">样式|缩放</td>
						</tr>
						<tr>
						    <td style="text-align: left;" colspan="2"> 
			                	<select name="styleForLabel" lay-filter="styleForLabel"  lay-verify="required" required>
						        	<option value="0">填充(无轮廓)</option>
									<option value="1">轮廓(无填充)</option>
									<option value="2">填充和轮廓</option>
						      	</select>
							</td> 
						    <td style="text-align: left;" colspan="2"> 
			                	<input name="scaleForLabel" autocomplete="off"  placeholder="请输入缩放值" type="text" class="layui-input" />
							</td> 
						</tr>
						<tr>
							<td colspan="4" style="text-align: left;">轮廓颜色和大小|背景颜色</td>
						</tr>
						<tr>
							<td colspan="2"  style="text-align: left;">
								<div class="layui-inline" style="padding-right: 0px;margin-right: 0px;">
									<input type="hidden" name="outlineColorForLabel" id="outlineColorForLabel-input">
									<div id="outlineColorForLabel"></div>
								</div>
								<div class="layui-inline" style="padding-right: 0px;margin-right: 0px;">
			                		<input name="outlineWidthForLabel" autocomplete="off"  placeholder="请输入大小" type="text" class="layui-input" />
								</div>					
			                </td> 
							<td colspan="2"  style="text-align: left;">
								<div class="layui-inline" style="padding-right: 0px;margin-right: 0px;">
									<input type="hidden" name="backgroundColorForLabel" id="backgroundColorForLabel-input">
									<div id="backgroundColorForLabel"></div>
								</div>
								<div class="layui-inline" style="padding-right: 0px;margin-right: 0px;width: 200px;">
			                		<select name="showBackgroundForLabel" lay-filter="showBackgroundForLabel"  lay-verify="required" required>
						        		<option value="0">隐藏</option>
										<option value="1">显示</option>
						      		</select>
								</div>					
			                </td> 
						</tr>
						<tr>
							<td colspan="4" style="text-align: left;">背景内边距</td>
						</tr>
						<tr>
							<td colspan="2">
			                	<input name="backgroundPaddingXForLabel" autocomplete="off"  placeholder="请输入x" type="text" class="layui-input" />
			                </td>
							<td colspan="2">
			                	<input name="backgroundPaddingYForLabel" autocomplete="off"  placeholder="请输入y" type="text" class="layui-input" />
			                </td>
						</tr>
						<tr>
							<td colspan="2" style="text-align: left;">可视范围</td>
							<td colspan="2" style="text-align: left;">偏移</td>
						</tr>
						<tr>
							<td >
			                	<input name="displayNearForLabel" autocomplete="off"  placeholder="请输入近" type="text" class="layui-input" />
			                </td>
							<td >
			                	<input name="displayFarForLabel" autocomplete="off"  placeholder="请输入远" type="text" class="layui-input" />
			                </td>
							<td >
			                	<input name="pixelOffsetXForLabel" autocomplete="off" value="0"  placeholder="请输入近" type="text" class="layui-input" />
			                </td>
							<td >
			                	<input name="pixelOffsetYForLabel" autocomplete="off" value="0"  placeholder="请输入远" type="text" class="layui-input" />
			                </td>
						</tr>
						<tr>
							<td colspan="4" style="text-align: left;">对齐方式</td>
						</tr>
						<tr>
							<td colspan="2" style="text-align: left;">
			                		<select name="horizontalOriginForLabel" lay-filter="horizontalOriginForLabel"  lay-verify="required" required>
						        		<option value="0">水平居中</option>
										<option value="1">水平靠左</option>
										<option value="2">水平靠右</option>
						      		</select>
			                </td>
							<td colspan="2" style="text-align: left;">
			                		<select name="verticalOriginForLabel" lay-filter="verticalOriginForLabel"  lay-verify="required" required>
						        		<option value="0">垂直居中</option>
										<option value="1">垂直置底</option>
						        		<option value="2">垂直BASELINE</option>
										<option value="3">垂直置顶</option>
						      		</select>
			                </td>
						</tr>
						<tr>
							<td colspan="4" style="text-align: left;">距离缩放</td>
						</tr>
						<tr>
							<td >
			                	<input name="scalarNearForLabel" autocomplete="off" placeholder="请输入近" type="text" class="layui-input" />
			                </td>
							<td >
			                	<input name="scalarNearValueForLabel" autocomplete="off" placeholder="请输入值(近)" type="text" class="layui-input" />
			                </td>
							<td >
			                	<input name="scalarFarForLabel" autocomplete="off" placeholder="请输入远" type="text" class="layui-input" />
			                </td>
							<td >
			                	<input name="scalarFarValueForLabel" autocomplete="off" placeholder="请输入值(远)" type="text" class="layui-input" />
			                </td>
						</tr>
						<tr>
							<td colspan="4" style="text-align: left;">距离偏移</td>
						</tr>
						<tr>
							<td >
			                	<input name="pixelOffsetScaleNearForLabel" autocomplete="off" placeholder="请输入近" type="text" class="layui-input" />
			                </td>
							<td >
			                	<input name="pixelOffsetScaleNearValueForLabel" autocomplete="off" placeholder="请输入值(近)" type="text" class="layui-input" />
			                </td>
							<td >
			                	<input name="pixelOffsetScaleFarForLabel" autocomplete="off" placeholder="请输入远" type="text" class="layui-input" />
			                </td>
							<td >
			                	<input name="pixelOffsetScaleFarValueForLabel" autocomplete="off" placeholder="请输入值(远)" type="text" class="layui-input" />
			                </td>
						</tr>
						<tr>
							<td colspan="4" style="text-align: left;">距离透明度</td>
						</tr>
						<tr>
							<td >
			                	<input name="translucencyNearForLabel" autocomplete="off"  placeholder="请输入近" type="text" class="layui-input" />
			                </td>
							<td >
			                	<input name="translucencyNearValueForLabel" autocomplete="off"  placeholder="请输入值(近)" type="text" class="layui-input" />
			                </td>
							<td >
			                	<input name="translucencyFarForLabel" autocomplete="off"  placeholder="请输入远" type="text" class="layui-input" />
			                </td>
							<td >
			                	<input name="translucencyFarValueForLabel" autocomplete="off"  placeholder="请输入值(远)" type="text" class="layui-input" />
			                </td>
						</tr>
					</table> 
				</div>
			    <div class="layui-tab-item">
					<table class="formTable">
						<tr>
							<td colspan="4" style="text-align: left;background: floralwhite;">
								<div class="layui-inline" style="padding-right: 10px;margin-right: 0px;">
									<input type="hidden" name="imageForBillboard" id="imageForBillboard-input">
									<img id="imageForBillboard-img" src="#(ctx)/assets/img/position.png" width="35" height="35" />
								</div>
								<div class="layui-inline" style="padding-right: 0px;margin-right: 0px;">
									<button class="layui-btn layui-btn-xs" id="imageForBillboard-select-btn" >选择</button>
								</div>
								<div class="layui-inline" style="padding-right: 0px;margin-right: 0px;">
									<span>点击“选择”按钮选取图标，目前支持支选择图库里的图标</span>
								</div>
			                </td>
						</tr>
						<tr>
							<td colspan="4" style="text-align: left;">属性</td>
						</tr>
						<tr>
							<td>
			                	<input name="scaleForBillboard"  autocomplete="off"  placeholder="图标缩放" type="text" class="layui-input" />
			                </td>
							<td>
			                	<input name="widthForBillboard" id="widthForBillboard" autocomplete="off"  placeholder="图标宽度" type="text" class="layui-input" />
			                </td>
							<td>
			                	<input name="heightForBillboard" id="heightForBillboard" autocomplete="off"  placeholder="图标高度" type="text" class="layui-input" />
			                </td>
						    <td style="text-align: left;"> 
			                	<select name="showForBillboard" lay-filter="showForBillboard"  lay-verify="required" required>
						        	<option value="0">隐藏</option>
									<option value="1">显示</option>
						      	</select>
							</td>
						</tr>
						<tr>
							<td colspan="4" style="text-align: left;">偏移</td>
						</tr>
						<tr>
							<td colspan="2">
			                	<input name="pixelOffsetXForBillboard" autocomplete="off" value="0"  placeholder="请输入近" type="text" class="layui-input" />
			                </td>
							<td colspan="2">
			                	<input name="pixelOffsetYForBillboard" autocomplete="off" value="0"  placeholder="请输入远" type="text" class="layui-input" />
			                </td>
						</tr>
						<tr>
							<td colspan="4" style="text-align: left;">可视范围</td>
						</tr>
						<tr>
							<td colspan="2">
			                	<input name="displayNearForBillboard" autocomplete="off" value="0"  placeholder="请输入近" type="text" class="layui-input" />
			                </td>
							<td colspan="2">
			                	<input name="displayFarForBillboard" autocomplete="off" value="5000"  placeholder="请输入远" type="text" class="layui-input" />
			                </td>
						</tr>
						<tr>
							<td colspan="4" style="text-align: left;">距离偏移</td>
						</tr>
						<tr>
							<td >
			                	<input name="pixelOffsetScaleNearForBillboard" autocomplete="off" placeholder="请输入近" type="text" class="layui-input" />
			                </td>
							<td >
			                	<input name="pixelOffsetScaleNearValueForBillboard" autocomplete="off" placeholder="请输入值(近)" type="text" class="layui-input" />
			                </td>
							<td >
			                	<input name="pixelOffsetScaleFarForBillboard" autocomplete="off" placeholder="请输入远" type="text" class="layui-input" />
			                </td>
							<td >
			                	<input name="pixelOffsetScaleFarValueForBillboard" autocomplete="off" placeholder="请输入值(远)" type="text" class="layui-input" />
			                </td>
						</tr>
						<tr>
							<td colspan="4" style="text-align: left;">距离缩放</td>
						</tr>
						<tr>
							<td >
			                	<input name="scalarNearForBillboard" autocomplete="off" placeholder="请输入近" type="text" class="layui-input" />
			                </td>
							<td >
			                	<input name="scalarNearValueForBillboard" autocomplete="off" placeholder="请输入值(近)" type="text" class="layui-input" />
			                </td>
							<td >
			                	<input name="scalarFarForBillboard" autocomplete="off" placeholder="请输入远" type="text" class="layui-input" />
			                </td>
							<td >
			                	<input name="scalarFarValueForBillboard" autocomplete="off" placeholder="请输入值(远)" type="text" class="layui-input" />
			                </td>
						</tr>
						<tr>
							<td colspan="4" style="text-align: left;">距离透明度</td>
						</tr>
						<tr>
							<td >
			                	<input name="translucencyNearForBillboard" autocomplete="off"  placeholder="请输入近" type="text" class="layui-input" />
			                </td>
							<td >
			                	<input name="translucencyNearValueForBillboard" autocomplete="off"  placeholder="请输入值(近)" type="text" class="layui-input" />
			                </td>
							<td >
			                	<input name="translucencyFarForBillboard" autocomplete="off"  placeholder="请输入远" type="text" class="layui-input" />
			                </td>
							<td >
			                	<input name="translucencyFarValueForBillboard" autocomplete="off"  placeholder="请输入值(远)" type="text" class="layui-input" />
			                </td>
						</tr>
					</table>


				</div>
			  </div>
			</div>
			<div style="text-align: right;padding: 10px;">
				<button class="layui-btn" lay-filter="modelSubmitBizStylePointForm" lay-submit>保存</button>
			</div>
	    </div>
	</div>
</form>
</script>

<script type="text/html" id="modelIconForBizStylePoint"> 
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-body table-tool-mini">
            <div class="layui-form toolbar" id="tbToolBar">
                <div class="layui-form-item">
                    <div class="layui-inline" style="float: left;">
						<div class="layui-inline" style="padding-right: 0px;margin-right: 0px;">
							<div class="layui-input-inline mr0">
								<input name="name" class="layui-input" type="text" placeholder="请输入名称"/>
							</div>
						</div>
						<div class="layui-inline" style="padding-right: 0px;margin-right: 0px;">
							<button class="layui-btn icon-btn" lay-filter="formSubSearchIconForBizStylePoint" lay-submit>
								<i class="layui-icon">&#xe615;</i>查询
							</button>
						</div>					
					</div>
				</div>
				<table class="layui-table" id="tableIconForBizStylePoint" lay-filter="tableIconForBizStylePoint"></table>
			</div>
			<div style="text-align: right;padding: 10px;">
				<button class="layui-btn" id="modelIconForBizStylePointBtn">确定</button>
			</div>
		</div>
	</div>
</div>
</script>

<script type="text/html" id="modelPositionForBizStylePoint"> 
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-body table-tool-mini">
            <div class="layui-form toolbar" id="tbToolBar">
                <div class="layui-form-item">
                    <div class="layui-inline" style="float: left;">
						<div class="layui-inline" style="padding-right: 0px;margin-right: 0px;">
							<div class="layui-input-inline mr0">
								<input name="name" class="layui-input" type="text" placeholder="请输入名称"/>
							</div>
						</div>
						<div class="layui-inline" style="padding-right: 0px;margin-right: 0px;">
							<button class="layui-btn icon-btn" lay-filter="formSubSearchPositionForBizStylePoint" lay-submit>
								<i class="layui-icon">&#xe615;</i>查询
							</button>
						</div>					
					</div>
				</div>
				<table class="layui-table" id="tablePositionForBizStylePoint" lay-filter="tablePositionForBizStylePoint"></table>
			</div>
			<div style="text-align: right;padding: 10px;">
				<button class="layui-btn" id="modelPositionForBizStylePointBtn">确定</button>
			</div>
		</div>
	</div>
</div>
</script>

<!-- js部分 -->
<script>
    layui.use(['layer', 'form', 'table', 'util', 'admin', 'config','colorpicker'], function () {
        var $ = layui.jquery;
        var layer = layui.layer;
        var form = layui.form;
        var table = layui.table;
        var util = layui.util;
        var admin = layui.admin;
        var config = layui.config;
        var colorpicker = layui.colorpicker;
        // 渲染表格
        var insTb = table.render({
            elem: '#tableBizStylePoint',
            url: '#(ctx)/biz/style/point/listData', 
            page: true,
            toolbar: false,
            cellMinWidth: 100,
            cols: [[
                {type: 'numbers', title: '序号'},
                {
                    align: 'center', templet: function (d) {
                    	if(d.imageForBillboard)
                        	return '<img src="#(ctx)'+d.imageForBillboard+'"  />';
                        else
                        	return '';
                    }, title: '缩略图', width: 100, unresize: true
                },
                {field: 'name', sort: false, title: '名称'},
                {
                    field: 'createTime', sort: false, templet: function (d) {
                        return util.toDateString(d.createTime);
                    }, title: '创建时间'
                },
				{field: 'status', sort: false, templet: '#tableStateBizStylePoint', title: '状态', align: 'center'},
                {align: 'left', toolbar: '#tableBarBizStylePoint', title: '操作'}
            ]],
        });

        // 添加
		$('#btnAddBizStylePoint').click(function () {
			 showEditModel();
		});

        // 搜索
        form.on('submit(formSubSearchBizStylePoint)', function (data) {
            insTb.reload({where: data.field}, 'data');
        });

        // 工具条点击事件
        table.on('tool(tableBizStylePoint)', function (obj) {
            var data = obj.data;
            var layEvent = obj.event;
            if (layEvent === 'edit') { // 修改
            	showEditModel(data);
            } else if (layEvent === 'del') { // 删除
                doDel(data.id, data.name);
            }
            else if (layEvent === 'copy') { // 删除
            	copy(data.id, data.name);
            }
            
        });

        // 删除
        function doDel(id, name) {
            layer.confirm('确定要删除“【<span style="color:red;">' + name + '</span>】”吗？', {
                skin: 'layui-layer-admin',
                shade: .1
            }, function (i) {
                layer.close(i);
                layer.load(2);
                admin.req('biz/style/point/delete', {
                    id: id
                }, function (res) {
                    layer.closeAll('loading');
                    if (res.code == 200) {
                        layer.msg(res.message, {icon: 1});
                        insTb.reload({}, 'data');
                    } else {
                        layer.msg(res.message, {icon: 2});
                    }
                }, 'get');
            });
        }
        
        function copy(id, name) {
            layer.confirm('确定要克隆“【<span style="color:red;">' + name + '</span>】”吗？', {
                skin: 'layui-layer-admin',
                shade: .1
            }, function (i) {
                layer.close(i);
                layer.load(2);
                admin.req('biz/style/point/copy', {
                    id: id
                }, function (res) {
                    layer.closeAll('loading');
                    if (res.code == 200) {
                        layer.msg(res.message, {icon: 1});
                        insTb.reload({}, 'data');
                    } else {
                        layer.msg(res.message, {icon: 2});
                    }
                }, 'get');
            });
        }

        // 显示表单弹窗
        function showEditModel(data) {
            layer.open({
                type: 1,
                shade: 0.3,
                offset: 't'	,
                title: (data ? '修改' : '添加') + '',
                area:'500px',
                resize :false,
                content: $('#modelBizStylePoint').html(),
                success: function (layero, dIndex) {
                    $(layero).children('.layui-layer-content').css('overflow', 'visible');
                    form.val('modelBizStylePointForm', data);  // 回显数据
                	colorpicker.render({//点颜色
                		elem: '#colorForPoint',
                		color: (data&&data.colorForPoint)?data.colorForPoint:null,
                		format: 'rgb',
                		predefine: true,
                		alpha: true,
                		done: function(color) {
                			$('#colorForPoint-input').val(color); //向隐藏域赋值
                			color || this.change(color); //清空时执行 change
                		},
                		change: function(color) {}
                	});
 
                	colorpicker.render({//点轮廓颜色
                		elem: '#outlineColorForPoint',
                		color: (data&&data.outlineColorForPoint)?data.outlineColorForPoint:null,
                		format: 'rgb',
                		predefine: true,
                		alpha: true,
                		done: function(color) {
                			$('#outlineColorForPoint-input').val(color); //向隐藏域赋值
                			color || this.change(color); //清空时执行 change
                		},
                		change: function(color) {}
                	}); 
                	
                	colorpicker.render({//标签填充颜色
                		elem: '#fillColorForLabel',
                		color: (data&&data.fillColorForLabel)?data.fillColorForLabel:null,
                		format: 'rgb',
                		predefine: true,
                		alpha: true,
                		done: function(color) {
                			$('#fillColorForLabel-input').val(color); //向隐藏域赋值
                			color || this.change(color); //清空时执行 change
                		},
                		change: function(color) {}
                	});
                	colorpicker.render({//标签轮廓颜色
                		elem: '#outlineColorForLabel',
                		color: (data&&data.outlineColorForLabel)?data.outlineColorForLabel:null,
                		format: 'rgb',
                		predefine: true,
                		alpha: true,
                		done: function(color) {
                			$('#outlineColorForLabel-input').val(color); //向隐藏域赋值
                			color || this.change(color); //清空时执行 change
                		},
                		change: function(color) {}
                	});
                	colorpicker.render({//标签背景颜色
                		elem: '#backgroundColorForLabel',
                		color: (data&&data.backgroundColorForLabel)?data.backgroundColorForLabel:null,
                		format: 'rgb',
                		predefine: true,
                		alpha: true,
                		done: function(color) {
                			$('#backgroundColorForLabel-input').val(color); //向隐藏域赋值
                			color || this.change(color); //清空时执行 change
                		},
                		change: function(color) {}
                	});
                	
                	//显示图片
                	if(data&& data.imageForBillboard){
                		$("#imageForBillboard-img").attr("src","#(ctx)/"+data.imageForBillboard);
                	}
                	
                	//选择图标
            		$('#imageForBillboard-select-btn').click(function () {
            			selectBillboardFromIcon(data);
            			return false;
           			});

            		//选择点位置样式
            		$('#positionselect-btn').click(function () {
            			selectStylePosition(data);
            			return false;
           			});
                	
                	
    			    form.on('submit(modelSubmitBizStylePointForm)', function (data) {
    			        layer.load(2);
    			        var formData={}; 
    			        for(var key in data.field){
    			        	formData['bizStylePoint.'+key]=data.field[key];
    			        }
                        admin.req("biz/style/point/save",formData, function (res) {
                            layer.closeAll('loading');
                            if (res.code == 200) {
                                layer.close(dIndex);
                                layer.msg(res.message, {icon: 1});
                                insTb.reload({}, 'data');
                            } else {
                                layer.msg(res.message, {icon: 2});
                            }
                        }, 'get');
    			        return false;
    			    });
    			    form.render(); 
                },
                end:function(){
                }
            });
        }
        
        function selectBillboardFromIcon(data){
            layer.open({
                type: 1,
                shade: 0.8,
                title:'图标库',
                area:'340px',
                resize :false,
                offset: 't'	,
                content: $('#modelIconForBizStylePoint').html(),
                success: function (layero, dIndex) {
                    $(layero).children('.layui-layer-content').css('overflow', 'visible');
                    var insTbIconForBizStylePoint = table.render({
                        elem: '#tableIconForBizStylePoint',
                        url: '#(ctx)/biz/icon/listData',
                        page: true,
                        toolbar: false,
                        cols: [[
                            {type:'radio'},
                            {
                                align: 'center', templet: function (d) {
                                	if(d.url)
                                    	return '<img src="#(ctx)'+d.url+'" />';
                                    else
                                    	return '';
                                }, title: '缩略图',
                            },
                            {field: 'name', sort: false, title: '名称'}
                        ]],
                    });
                    
            		$('#modelIconForBizStylePointBtn').click(function () {
            			var checkStatus = table.checkStatus("tableIconForBizStylePoint"); //获取选中行状态
    			        var data = checkStatus.data;  //获取选中行数据
    			        if(data && data.length>0){
    			        	$("#imageForBillboard-img").attr("src","#(ctx)/"+data[0].url);
    			        	$("#imageForBillboard-input").val(data[0].url);
    			        	$("#widthForBillboard").val(data[0].width);
    			        	$("#heightForBillboard").val(data[0].height);
    			        }
    			        layer.close(dIndex);
           			});
                    
                    form.on('submit(formSubSearchIconForBizStylePoint)', function (data) {
                    	insTbIconForBizStylePoint.reload({where: data.field}, 'data');
                    });
                },
                end:function(){
                }
            });
        }


        function selectStylePosition(data){
            layer.open({
                type: 1,
                shade: 0.8,
                title:'点位置样式',
                area:'340px',
                resize :false,
                offset: 't'	,
                content: $('#modelPositionForBizStylePoint').html(),
                success: function (layero, dIndex) {
                    $(layero).children('.layui-layer-content').css('overflow', 'visible');
                    var insTbPositionForBizStylePoint = table.render({
                        elem: '#tablePositionForBizStylePoint',
                        url: '#(ctx)/biz/style/point/position/listData',
                        page: true,
                        toolbar: false,
                        cols: [[
                            {type:'radio'},
                            {field: 'name', sort: false, title: '名称'},
                            {
                                field: 'createTime', sort: false, templet: function (d) {
                                    return util.toDateString(d.createTime);
                                }, title: '创建时间'
                            },
                        ]],
                    });
                    
            		$('#modelPositionForBizStylePointBtn').click(function () {
            			var checkStatus = table.checkStatus("tablePositionForBizStylePoint"); //获取选中行状态
    			        var data = checkStatus.data;  //获取选中行数据
    			        if(data && data.length>0){   	 
    			        	  $("input[name='stylePointPositionName']").attr("value", data[0].name);
    			        	  $("input[name='stylePointPositionId']").attr("value", data[0].id); 

    			        	  $("input[name='displayNearForPoint']").attr("value", data[0].displayNear); 
    			        	  $("input[name='displayFarForPoint']").attr("value", data[0].displayFar); 
    			        	  $("input[name='scalarNearForPoint']").attr("value", data[0].scalarNear); 
    			        	  $("input[name='scalarNearValueForPoint']").attr("value", data[0].scalarNearValue); 
    			        	  $("input[name='scalarFarForPoint']").attr("value", data[0].scalarFar); 
    			        	  $("input[name='scalarFarValueForPoint']").attr("value", data[0].scalarFarValue); 
    			        	  $("input[name='translucencyNearForPoint']").attr("value", data[0].translucencyNear); 
    			        	  $("input[name='translucencyNearValueForPoint']").attr("value", data[0].translucencyNearValue); 
    			        	  $("input[name='translucencyFarForPoint']").attr("value", data[0].translucencyFar); 
    			        	  $("input[name='translucencyFarValueForPoint']").attr("value", data[0].translucencyFarValue); 

    			        	  $("input[name='displayNearForLabel']").attr("value", data[0].displayNear); 
    			        	  $("input[name='displayFarForLabel']").attr("value", data[0].displayFar); 
    			        	  $("input[name='pixelOffsetXForLabel']").attr("value", data[0].pixelOffsetX); 
    			        	  $("input[name='pixelOffsetYForLabel']").attr("value", data[0].pixelOffsetY); 
    			        	  
    			        	  $("input[name='scalarNearForLabel']").attr("value", data[0].scalarNear); 
    			        	  $("input[name='scalarNearValueForLabel']").attr("value", data[0].scalarNearValue); 
    			        	  $("input[name='scalarFarForLabel']").attr("value", data[0].scalarFar); 
    			        	  $("input[name='scalarFarValueForLabel']").attr("value", data[0].scalarFarValue); 
    			        	  $("input[name='translucencyNearForLabel']").attr("value", data[0].translucencyNear); 
    			        	  $("input[name='translucencyNearValueForLabel']").attr("value", data[0].translucencyNearValue); 
    			        	  $("input[name='translucencyFarForLabel']").attr("value", data[0].translucencyFar); 
    			        	  $("input[name='translucencyFarValueForLabel']").attr("value", data[0].translucencyFarValue); 

    			        	  $("input[name='pixelOffsetScaleNearForLabel']").attr("value", data[0].pixelOffsetScaleNear); 
    			        	  $("input[name='pixelOffsetScaleNearValueForLabel']").attr("value", data[0].pixelOffsetScaleNearValue); 
    			        	  $("input[name='pixelOffsetScaleFarForLabel']").attr("value", data[0].pixelOffsetScaleFar); 
    			        	  $("input[name='pixelOffsetScaleFarValueForLabel']").attr("value", data[0].pixelOffsetScaleFarValue); 



    			        	  $("input[name='displayNearForBillboard']").attr("value", data[0].displayNear); 
    			        	  $("input[name='displayFarForBillboard']").attr("value", data[0].displayFar); 
    			        	  $("input[name='pixelOffsetXForBillboard']").attr("value", data[0].pixelOffsetX); 
    			        	  $("input[name='pixelOffsetYForBillboard']").attr("value", data[0].pixelOffsetY); 
    			        	  
    			        	  $("input[name='scalarNearForBillboard']").attr("value", data[0].scalarNear); 
    			        	  $("input[name='scalarNearValueForBillboard']").attr("value", data[0].scalarNearValue); 
    			        	  $("input[name='scalarFarForBillboard']").attr("value", data[0].scalarFar); 
    			        	  $("input[name='scalarFarValueForBillboard']").attr("value", data[0].scalarFarValue); 
    			        	  $("input[name='translucencyNearForBillboard']").attr("value", data[0].translucencyNear); 
    			        	  $("input[name='translucencyNearValueForBillboard']").attr("value", data[0].translucencyNearValue); 
    			        	  $("input[name='translucencyFarForBillboard']").attr("value", data[0].translucencyFar); 
    			        	  $("input[name='translucencyFarValueForBillboard']").attr("value", data[0].translucencyFarValue); 

    			        	  $("input[name='pixelOffsetScaleNearForBillboard']").attr("value", data[0].pixelOffsetScaleNear); 
    			        	  $("input[name='pixelOffsetScaleNearValueForBillboard']").attr("value", data[0].pixelOffsetScaleNearValue); 
    			        	  $("input[name='pixelOffsetScaleFarForBillboard']").attr("value", data[0].pixelOffsetScaleFar); 
    			        	  $("input[name='pixelOffsetScaleFarValueForBillboard']").attr("value", data[0].pixelOffsetScaleFarValue); 
    			        	  
 
    			        }
    			        layer.close(dIndex);
           			});
                    
                    form.on('submit(formSubSearchPositionForBizStylePoint)', function (data) {
                    	insTbPositionForBizStylePoint.reload({where: data.field}, 'data');
                    });
                },
                end:function(){
                }
            });
        }
        
    });
</script>
